function LRU(conCurrency) {
    this.cache = new Map();
    this.conCurrency = conCurrency
}

LRU.prototype.get = function (key) {
    if (this.cache.has(key)) {
        let temp = this.cache.get(key)
        this.cache.delete(key)
        this.cache.set(key, temp)
        return temp
    }
    return -1
}

LRU.prototype.set = function (key, value) {
    if (this.cache.has(key)) {
        this.cache.delete(key)
    }
    if (this.conCurrency <= this.cache.size()) {
        this.cache.delete(this.cache.keys.next().value)  // map.keys().next().value
    }
    this.cache.set(key, value)
}